package com.eamois.ui.util;

import java.awt.Color;
import java.awt.Component;

import javax.swing.ImageIcon;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;

import com.ufidaicon.icons.BrowserUfidaIcons;

public class DeptTreeRenderer extends DefaultTreeCellRenderer{
	public DeptTreeRenderer() {
		
	}
	
	public Component getTreeCellRendererComponent(JTree tree, Object value,
			boolean sel, boolean expanded, boolean leaf, int row,
			boolean hasFocus) {
		super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf,
				row, hasFocus);
		DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
//		if (node.isRoot()) {
//			setIcon(new ImageIcon(com.eamois.icon.GetIcons.class
//					.getResource("part.png")));			
//		}else {
//			setIcon(new ImageIcon(com.eamois.icon.GetIcons.class
//					.getResource("equipment_detail.png")));			
//		}
		if (node.isRoot()) {
			setIcon(BrowserUfidaIcons.ICON_MATERIAL_CASTPART);			
		}else {
			setIcon(BrowserUfidaIcons.ICON_MATERIAL_SELFPART);			
		}
		return this;
	}
}
